package com.selfdiscipline.ui.components.common

import androidx.compose.material3.Button
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color

/**
 * 优先级按钮组件，可在多个界面中复用
 *
 * @param text 按钮文本
 * @param selected 是否选中
 * @param onClick 点击事件
 * @param color 选中时的颜色
 * @param modifier 修饰符
 */
@Composable
fun PriorityButton(
    text: String,
    selected: Boolean,
    onClick: () -> Unit,
    color: Color,
    modifier: Modifier = Modifier
) {
    val buttonColors = if (selected) {
        ButtonDefaults.buttonColors(
            containerColor = color,
            contentColor = MaterialTheme.colorScheme.onPrimary
        )
    } else {
        ButtonDefaults.outlinedButtonColors()
    }
    
    Button(
        onClick = onClick,
        colors = buttonColors,
        modifier = modifier
    ) {
        Text(text = text)
    }
} 